﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Threading;
using System.Globalization;

/// <summary>
///Language 的摘要说明
/// </summary>
public class Language
{
	public Language()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}
    public void LanChange(string selectlanguage)
    {
        string languagetype = "";
        switch (selectlanguage)
        {
            case "1":
                languagetype = "zh-CN";                
                break;
            case "2":
                languagetype = "en-US";
                break;
            default:
                break;

        }
        if (languagetype != "")
        {
            HttpContext.Current.Session["languagetype"] = languagetype;
            Culture(languagetype);
        }
    }
    private void Culture(string languagetype)
    {
        try
        {
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(languagetype);
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(languagetype);   
            
        }
        catch (Exception)
        { }
    }
}